<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePosicionTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreatePosicionLabel_id}" for="id" />
                    <h:inputText id="id" value="#{posicionController.selected.id}" title="#{bundle.CreatePosicionTitle_id}" required="true" requiredMessage="#{bundle.CreatePosicionRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreatePosicionLabel_fecha}" for="fecha" />
                    <h:inputText id="fecha" value="#{posicionController.selected.fecha}" title="#{bundle.CreatePosicionTitle_fecha}" required="true" requiredMessage="#{bundle.CreatePosicionRequiredMessage_fecha}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreatePosicionLabel_longitud}" for="longitud" />
                    <h:inputText id="longitud" value="#{posicionController.selected.longitud}" title="#{bundle.CreatePosicionTitle_longitud}" required="true" requiredMessage="#{bundle.CreatePosicionRequiredMessage_longitud}"/>
                    <h:outputLabel value="#{bundle.CreatePosicionLabel_latitud}" for="latitud" />
                    <h:inputText id="latitud" value="#{posicionController.selected.latitud}" title="#{bundle.CreatePosicionTitle_latitud}" required="true" requiredMessage="#{bundle.CreatePosicionRequiredMessage_latitud}"/>
                    <h:outputLabel value="#{bundle.CreatePosicionLabel_cargaId}" for="cargaId" />
                    <h:selectOneMenu id="cargaId" value="#{posicionController.selected.cargaId}" title="#{bundle.CreatePosicionTitle_cargaId}" required="true" requiredMessage="#{bundle.CreatePosicionRequiredMessage_cargaId}">
                        <f:selectItems value="#{cargaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{posicionController.create}" value="#{bundle.CreatePosicionSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{posicionController.prepareList}" value="#{bundle.CreatePosicionShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreatePosicionIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
